<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('出库流水列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>作业编号：</label>
                                <input type="text" name="jobId"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="status" th:with="type=${@dict.getType('job_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>任务号：</label>
                                <input type="text" name="taskNo"/>
                            </li>
                            <li>
                                <label>巷道：</label>
                                <input type="text" name="roadwayId"/>
                            </li>
                            <li>
                                <label>货位名称：</label>
                                <input type="text" name="cargoSpaceName"/>
                            </li>
                            <li>
                                <label>出库类型：</label>
                                <select name="inOrOut" th:with="type=${@dict.getType('outjob')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>物料编号：</label>
                                <input type="text" name="productId"/>
                            </li>
                            <li>
                                <label>物料名称：</label>
                                <input type="text" name="productName"/>
                            </li>
                            <li>
                                <label>比例号：</label>
                                <input type="text" name="productDetailId"/>
                            </li>
                            <li>
                                <label>客户：</label>
                                <input type="text" name="grade"/>
                            </li>
                            <li>
                                <label>起止时间：</label>
                                <input type="text" class="time-input" data-type="datetime" placeholder="请单击选择开始时间：" name="startTime" id="startTime"/>---
                                <input type="text" class="time-input" data-type="datetime" placeholder="请单击选择结束时间：" name="finishTime" id="finishTime"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formId','bootstrap-table')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId','bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-bordered" style="overflow:scroll;width: 100%">
                <table id="bootstrap-table" class="table text-nowrap" style="min-width: 100%"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:outJobHistory:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:outJobHistory:remove')}]];
        var statusDatas = [[${@dict.getType('job_status')}]];
        var inOrOutDatas = [[${@dict.getType('outjob')}]];
        var prefix = ctx + "search/outJobHistory";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "出库流水",
                pageSize: 10,
                pageList: [10,25,50],
                clickToSelect: true,//是否启用点击选中行
                uniqueId:"jobDetailId",//表主键(用于修改和删除)
                sortName:"jobDetailId",//必加排序 sortOrder: "asc"默认
                columns: [
                    {
                        halign: 'center',
                        align:'center',
                        checkbox: true
                    },

                {
                    field: 'jobDetailId',
                    title: '子表编号',
                    halign: 'center',
                    align:'center',
                    visible: false
                },
                {
                    field: 'jobId',
                    title: '作业编号',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'status',
                    title: '状态',
                    halign: 'center',
                    align:'center',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'taskNo',
                    title: '任务号',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'roadwayId',
                    title: '巷道',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'cargoSpaceId',
                    title: '货位编号',
                    halign: 'center',
                    align:'center',
                    visible: false
                },
                {
                    field: 'cargoSpaceName',
                    title: '货位名称',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'priority',
                    title: '优先级',
                    halign: 'center',
                    align:'center',
                    visible: false
                },
                {
                    field: 'inOrOut',
                    title: '出库类型',
                    halign: 'center',
                    align:'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(inOrOutDatas, value);
                    }
                },
                {
                    field: 'productId',
                    title: '物料编号',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'productName',
                    title: '物料名称',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'lotNo',
                    title: '批号',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'productGuid',
                    title: '规格说明',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'productDetailId',
                    title: '比例号',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'outQuantity',
                    title: '出库数量',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'stackingId',
                    title: '垛型',
                    halign: 'center',
                    align:'center',
                    visible: false
                },
                {
                    field: 'spec',
                    title: '供应商',
                    halign: 'center',
                    align:'center',
                    visible: false
                },
                {
                    field: 'grade',
                    title: '客户',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'startTime',
                    title: '开始时间',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'finishTime',
                    title: '结束时间',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'warehouseId',
                    title: '仓库',
                    halign: 'center',
                    align:'center',
                    formatter: function (value, index, row){
                        if (value == '01'){
                            return '立体库';
                        }
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>